<?

class Mdl_Sessions extends MY_Model {

    function Mdl_Sessions() {

        parent::MY_Model();

    }

    function set_last_index($last_index = NULL) {

        if (!$last_index) {

            $this->session->set_userdata('last_index', $this->uri->uri_string());

        }

        else {

            $this->session->set_userdata('last_index', $last_index);

        }

    }

    function validate_login() {

        $this->fields = array(
            'email_address' =>  'Email Address',
            'password'      =>  'Password'
        );

        $this->rules = array(
            'email_address' =>  'required|valid_email',
            'password'      =>  'required|md5'
        );

        return $this->_validate();

    }

}

?>